package com.coach.common;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import com.google.gson.Gson;
import com.google.gson.JsonElement;

public class JsonResultWriter{
	public static void write(HttpServletResponse response , Object object) throws ServletException, IOException{
		
		response.setContentType("application/json");
		Gson gson =new Gson();
		String json=gson.toJson(object);
		PrintWriter writer= response.getWriter();
		writer.print(json);
		writer.close();
	
	}
	
}
